/*
 *  modifier: Honrun
 */
#include <stdio.h>
#include <stdlib.h>
#include "string.h"
#include "sha1.h"
#include "sha256.h"
#include "sha512.h"
#include "md5.h"




int main()
{
    int32_t i = 0;
    uint8_t strings[32] = "Hello honrun.";
    uint8_t sha1sum[20] = {0}, sh224sum[28] = {0}, sha256sum[32] = {0}, sha384sum[48] = {0}, sha512sum[64] = {0}, md5sum[16] = {0};


    printf("Hello hash test.\r\n\n");


    mbedtls_md5_ret(strings, strlen(strings), md5sum);
    mbedtls_sha1_ret(strings, strlen(strings), sha1sum);
    mbedtls_sha256_ret(strings, strlen(strings), sh224sum, 1);
    mbedtls_sha256_ret(strings, strlen(strings), sha256sum, 0);
    mbedtls_sha512_ret(strings, strlen(strings), sha384sum, 1);
    mbedtls_sha512_ret(strings, strlen(strings), sha512sum, 0);


    printf("md5.\r\n");
    for(i = 0; i < sizeof(md5sum); ++i)
    {
        printf("%02X ", md5sum[i]);
    }
    printf("\r\n\n");


    printf("sha1.\r\n");
    for(i = 0; i < sizeof(sha1sum); ++i)
    {
        printf("%02X ", sha1sum[i]);
    }
    printf("\r\n\n");


    printf("sh224.\r\n");
    for(i = 0; i < sizeof(sh224sum); ++i)
    {
        printf("%02X ", sh224sum[i]);
    }
    printf("\r\n\n");


    printf("sha256.\r\n");
    for(i = 0; i < sizeof(sha256sum); ++i)
    {
        printf("%02X ", sha256sum[i]);
    }
    printf("\r\n\n");


    printf("sha384.\r\n");
    for(i = 0; i < sizeof(sha384sum); ++i)
    {
        printf("%02X ", sha384sum[i]);
    }
    printf("\r\n\n");


    printf("sha512.\r\n");
    for(i = 0; i < sizeof(sha512sum); ++i)
    {
        printf("%02X ", sha512sum[i]);
    }
    printf("\r\n\n");


    return 0;
}
